﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户注册</title>
    <link rel="stylesheet" href="../style/css/user/login.css">
    <script src="../style/js/jquery-1.8.3.js" type="text/javascript" charset="utf-8"></script>
    <script>
        function save() {
            $.post("../user/reg", $("#regForm").serialize(), function (res) {
                if (res.code === 200) {
                    alert(res.msg);
                    location.replace("user_login.html")
                } else if (res.code === 500) {
                    alert(res.msg);
                } else {
                    alert("添加失败");
                }
            },"json")
        }
    </script>

</head>
<body>
<div class="container">
    <form id="regForm">
        <div class="login-form">
            <div class="text">注册</div>
            <div class="form-item">
                <input type="text" name="nickName" placeholder="昵称">
                <input type="text" name="account" placeholder="账号">
                <input type="password" name="password" placeholder="密码">
            </div>
            <div class="btn" onclick="save()">保存</div>
            <div class="btn-back"></div>
            <div class="other">
                已有账号<a href="user_login.html">去登录</a>
            </div>
        </div>
    </form>
</div>

</body>
</html>
